package com.chenyongjing.design.pattern.decorator.battercake.v2;

import com.chenyongjing.design.pattern.decorator.battercake.v1.BatterCakeWithEgg;
import com.chenyongjing.design.pattern.decorator.battercake.v1.BatterCakeWithEggAndSauage;

public class Test {
    public static void main(String[] args) {
        BatterCake batterCake;

        batterCake = new BaseBatterCake();
        // 加一个鸡蛋
        batterCake = new EggDecorator(batterCake);
        // 加一根香肠
        batterCake = new SausageDecorator(batterCake);
        System.out.println(batterCake.getMsg()+"总价："+batterCake.getPrice());

    }
}
